Spring 5.0 Cookbook by Sherwin John Calleja Tragura

Spring 5.0 Cookbook by Sherwin John Calleja Tragura

Author:Sherwin John Calleja Tragura [Tragura, Sherwin John Calleja]
Language: eng
Format: azw3, pdf
Publisher: Packt Publishing
Published: 2017-10-10T04:00:00+00:00


@Test public void testGetValidEmployees(){ Subscriber<String> mySubscription = new Subscriber<String>() { @Override public void onComplete() { } @Override public void onError(Throwable e) { } @Override public void onNext(String name) { System.out.format("Employee: %s \n", name); } @Override public void onSubscribe(Subscription subs) { subs.request(Long.MAX_VALUE); } }; employeeStreamserviceImpl.getValidEmployees()

.subscribe(mySubscription); }

When Publisher triggers onErrorReturn() and doOnComplete(), Subscriber does not need to write any snippets in its onError() and onComplete() overrides.

Save all files. Execute all the test cases in TestEmployeeStreamservice and observe how the Publisher-Subscriber model works in the Reactive Streams specification.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.